#ifndef _SMTPUTIL_H_
#define _SMTPUTIL_H_

#include "socket.h"
#include "w5100s.h"

// SMTP_STATE

enum run_state
{
    waitfor220 = 0,
    waitforHELO250,
    waitforAUTH334,
    waitforuser334,
    waitforpassword235,
    waitforsend250,
    waitforrcpt250,
    waitfordate354,
    waitformime250
};

void send_mail(uint8_t sock);
void mailmessage(void);
void base64encode(char *s, char *r);
void str_insert(char *s1, char *s2, int pos);
void do_smtp(uint8_t sock);

#endif
